class Test < ActiveRecord::Base
  include ActiveModel::MassAssignmentSecurity
  
  attr_accessible :caption, :type, :parent
  attr_accessor :type, :parent
  
  def self.where_by_params(params)
    attrs = self.accessible_attributes
    
    result = {}
    params.each do |key, value| 
      if(attrs.include? key)
        result[key] = value
      end
    end
    
    return result
    
  end
  
end
